﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HKEA.CMS.Core.IDAL;
using HKEA.CMS.Core.IDAL.Mtbl;
using HKEA.CMS.Core.IDAL.Rej;
using HKEA.CMS.Core.IDAL.Stg;
using HKEA.CMS.Core.IDAL.Tbl;
using HKEA.CMS.Core.IDAL.App;

using HKEA.CMS.Core.DAL;
using HKEA.CMS.Core.DAL.App;
using HKEA.CMS.Core.DAL.Mtbl;
using HKEA.CMS.Core.DAL.Rej;
using HKEA.CMS.Core.DAL.Stg;
using HKEA.CMS.Core.DAL.Tbl;
using HKEA.CMS.Core.DAL;
using HKEA.CMS.Core.Models;
namespace HKEA.CMS.Core.DALFactory
{
    public class DataAccess
    {
        private DataAccess() { }
        private static object obj = new Object();
        //private static HKEA_CMSEntities _access = null;

        public static HKEA_CMSEntities GetModelInstance()
        {
            //if (_access == null)
            //{
            //    lock (obj)
            //    {
            //        if (_access == null)
            //        {
            //            _access = new HKEA_CMSEntities();
            //        }
            //    }
            //}
            //return _access;

            return new HKEA_CMSEntities();
        }

        #region Imtbl对象
        private static ImtblActiviteType _ImtblActiviteType = null;
        private static ImtblAttendee_Status _ImtblAttendee_Status = null;
        private static ImtblArea _ImtblArea = null;
        private static ImtblAttribute _ImtblAttribute = null;
        private static ImtblAuditTrailCat _ImtblAuditTrailCat = null;
        private static ImtblBusinessNature _ImtblBusinessNature = null;
        private static ImtblCommPosition _ImtblCommPosition = null;
        private static ImtblCommType _ImtblCommType = null;
        private static ImtblCountry _ImtblCountry = null;
        private static ImtblCurrency _ImtblCurrency = null;
        private static ImtblCustType _ImtblCustType = null;
        private static ImtblFunction _ImtblFunction = null;
        private static ImtblHistoryCat _ImtblHistoryCat = null;
        private static ImtblHistoryType _ImtblHistoryType = null;
        private static ImtblIndustry _ImtblIndustry = null;
        private static ImtblJobNature _ImtblJobNature = null;
        private static ImtblMembershipStatus _ImtblMembershipStatus = null;
        private static ImtblMembershipCategory _ImtblMembershipCategory= null;
        private static ImtblMemberType _ImtblMemberType = null;
        private static ImtblNameMap _ImtblNameMap = null;
        private static ImtblPosition _ImtblPosition = null;
        private static ImtblPrivilege _ImtblPrivilege = null;
        private static ImtblProdCat_Industry _ImtblProdCat_Industry = null;
        private static ImtblProductCat _ImtblProductCat = null;
        private static ImtblProductSubCat _ImtblProductSubCat = null;
        private static ImtblProvince _ImtblProvince = null;
        private static ImtblSalutation _ImtblSalutation = null;
        private static ImtblSource _ImtblSource = null;
        private static ImtblBrand _ImtblBrand = null;
        #endregion
        #region Imtbl实例    
        public static ImtblAttendee_Status CreateImtblAttendee_Status()
        {
            //if (_ImtblAttendee_Status == null)
                _ImtblAttendee_Status = mtblAttendee_StatusDAL.GetInstance();
            return _ImtblAttendee_Status;
        }
        public static ImtblActiviteType CreateActivityType()
        {
            //if (_ImtblActiviteType == null)
                _ImtblActiviteType = mtblActiviteTypeDAL.GetInstance();
            return _ImtblActiviteType;
        }
        public static ImtblArea CreateImtblArea()
        {
            //if (_ImtblArea == null)
                _ImtblArea = mtblAreaDAL.GetInstance();
                return _ImtblArea;
        }
        public static ImtblAttribute CreateImtblAttribute()
        {
            //if (_ImtblAttribute == null)
                _ImtblAttribute = mtblAttributeDAL.GetInstance();
            return _ImtblAttribute;
        }
        public static ImtblAuditTrailCat CreateImtblAuditTrailCat()
        {
            //if (_ImtblAuditTrailCat == null)
                _ImtblAuditTrailCat = mtblAuditTrailCatDAL.GetInstance();
            return _ImtblAuditTrailCat;
        }
        public static ImtblBusinessNature CreateImtblBusinessNature()
        {
            //if (_ImtblBusinessNature == null)
                _ImtblBusinessNature = mtblBusinessNatureDAL.GetInstance();
            return _ImtblBusinessNature;
        }
        public static ImtblCommPosition CreateImtblCommPosition()
        {
            //if (_ImtblCommPosition == null)
                _ImtblCommPosition = mtblCommPositionDAL.GetInstance();
            return _ImtblCommPosition;
        }
        public static ImtblCommType CreateImtblCommType()
        {
            //if (_ImtblCommType == null)
                _ImtblCommType = mtblCommTypeDAL.GetInstance();
            return _ImtblCommType;
        }
        public static ImtblCountry CreateImtblCountry()
        {
            //if (_ImtblCountry == null)
                _ImtblCountry = mtblCountryDAL.GetInstance();
            return _ImtblCountry;
        }
        public static ImtblCurrency CreateImtblCurrency()
        {
            //if (_ImtblCurrency == null)
                _ImtblCurrency = mtblCurrencyDAL.GetInstance();
            return _ImtblCurrency;
        }
        public static ImtblCustType CreateImtblCustType()
        {
            //if (_ImtblCustType == null)
                _ImtblCustType = mtblCustTypeDAL.GetInstance();
            return _ImtblCustType;
        }
        public static ImtblFunction CreateImtblFunction()
        {
            //if (_ImtblFunction == null)
                _ImtblFunction = mtblFunctionDAL.GetInstance();
            return _ImtblFunction;
        }
        public static ImtblHistoryCat CreateImtblHistoryCat()
        {
            //if (_ImtblHistoryCat == null)
                _ImtblHistoryCat = mtblHistoryCatDAL.GetInstance();
            return _ImtblHistoryCat;
        }
        public static ImtblHistoryType CreateImtblHistoryType()
        {
            //if (_ImtblHistoryType == null)
                _ImtblHistoryType = mtblHistoryTypeDAL.GetInstance();
            return _ImtblHistoryType;
        }
        public static ImtblIndustry CreateImtblIndustry()
        {
            //if (_ImtblIndustry == null)
                _ImtblIndustry = mtblIndustryDAL.GetInstance();
            return _ImtblIndustry;
        }
        public static ImtblJobNature CreateImtblJobNature()
        {
            //if (_ImtblJobNature == null)
                _ImtblJobNature = mtblJobNatureDAL.GetInstance();
            return _ImtblJobNature;
        }
        public static ImtblMembershipStatus CreateImtblMembershipStatus()
        {
            //if (_ImtblMembershipStatus == null)
                _ImtblMembershipStatus = mtblMembershipStatusDAL.GetInstance();
            return _ImtblMembershipStatus;
        }

        public static ImtblMembershipCategory CreateImtblMembershipCategory()
        {
            _ImtblMembershipCategory= mtblMembershipCategoryDAL.GetInstance();
            return _ImtblMembershipCategory;
        }

        public static ImtblMemberType CreateImtblMemberType()
        {
            //if (_ImtblMemberType == null)
                _ImtblMemberType = mtblMemberTypeDAL.GetInstance();
            return _ImtblMemberType;
        }
        public static ImtblNameMap CreateImtblNameMap()
        {
            //if (_ImtblNameMap == null)
                _ImtblNameMap = mtblNameMapDAL.GetInstance();
            return _ImtblNameMap;
        }
        public static ImtblPosition CreateImtblPosition()
        {
            //if (_ImtblPosition == null)
                _ImtblPosition = mtblPositionDAL.GetInstance();
            return _ImtblPosition;
        }
        public static ImtblPrivilege CreateImtblPrivilege()
        {
            //if (_ImtblPrivilege == null)
                _ImtblPrivilege = mtblPrivilegeDAL.GetInstance();
            return _ImtblPrivilege;
        }
        public static ImtblProdCat_Industry CreateImtblProdCat_Industry()
        {
            //if (_ImtblProdCat_Industry == null)
                _ImtblProdCat_Industry = mtblProdCat_IndustryDAL.GetInstance();
            return _ImtblProdCat_Industry;
        }
        public static ImtblProductCat CreateImtblProductCat()
        {
            //if (_ImtblProductCat == null)
                _ImtblProductCat = mtblProductCatDAL.GetInstance();
            return _ImtblProductCat;
        }
        public static ImtblProductSubCat CreateImtblProductSubCat()
        {
            //if (_ImtblProductSubCat == null)
                _ImtblProductSubCat = mtblProductSubCatDAL.GetInstance();
            return _ImtblProductSubCat;
        }
        public static ImtblProvince CreateImtblProvince()
        {
            //if (_ImtblProvince == null)
                _ImtblProvince = mtblProvinceDAL.GetInstance();
            return _ImtblProvince;
        }
        public static ImtblSalutation CreateImtblSalutation()
        {
            //if (_ImtblSalutation == null)
                _ImtblSalutation = mtblSalutationDAL.GetInstance();
            return _ImtblSalutation;
        }
        public static ImtblSource CreateImtblSource()
        {
            //if (_ImtblSource == null)
            _ImtblSource = mtblSourceDAL.GetInstance();
            return _ImtblSource;
        }
        public static ImtblBrand CreateImtblBrand()
        {
            //if (_ImtblSource == null)
            _ImtblBrand = mtblBrandDAL.GetInstance();
            return _ImtblBrand;
        }
        #endregion

        #region Irej对象
        private static Irej_tblAddress _Irej_tblAddress = null;
        private static Irej_tblContactInfo _Irej_tblContactInfo = null;
        private static Irej_tblContactPerson _Irej_tblContactPerson = null;
        private static Irej_tblCPerson_Attribute _Irej_tblCPerson_Attribute = null;
        private static Irej_tblCPerson_CommMember _Irej_tblCPerson_CommMember = null;
        private static Irej_tblCPerson_JobNature _Irej_tblCPerson_JobNature = null;
        private static Irej_tblCPerson_Post _Irej_tblCPerson_Post = null;
        private static Irej_tblCust_Branch _Irej_tblCust_Branch = null;
        private static Irej_tblCust_Brand _Irej_tblCust_Brand = null;
        private static Irej_tblCust_BusNature _Irej_tblCust_BusNature = null;
        private static Irej_tblCust_ContactPerson _Irej_tblCust_ContactPerson = null;
        private static Irej_tblCust_Market _Irej_tblCust_Market = null;
        private static Irej_tblCust_Member _Irej_tblCust_Member = null;
        private static Irej_tblCust_ProdCat _Irej_tblCust_ProdCat = null;
        private static Irej_tblCust_WebLogin _Irej_tblCust_WebLogin = null;
        private static Irej_tblCustomer _Irej_tblCustomer = null;
        private static Irej_tblHistory _Irej_tblHistory = null;
        #endregion
        #region Irej实例
        public static Irej_tblAddress CreateIrej_tblAddress()
        {
            //if (_Irej_tblAddress == null)
                _Irej_tblAddress = rej_tblAddressDAL.GetInstance();
            return _Irej_tblAddress;
        }
        public static Irej_tblContactInfo CreateIrej_tblContactInfo()
        {
            //if (_Irej_tblContactInfo == null)
                _Irej_tblContactInfo = rej_tblContactInfoDAL.GetInstance();
            return _Irej_tblContactInfo;
        }
        public static Irej_tblCPerson_Attribute CreateIrej_tblCPerson_Attribute()
        {
            //if (_Irej_tblCPerson_Attribute == null)
                _Irej_tblCPerson_Attribute = rej_tblCPerson_AttributeDAL.GetInstance();
            return _Irej_tblCPerson_Attribute;
        }
        public static Irej_tblCPerson_CommMember CreateIrej_tblCPerson_CommMember()
        {
            //if (_Irej_tblCPerson_CommMember == null)
                _Irej_tblCPerson_CommMember = rej_tblCPerson_CommMemberDAL.GetInstance();
            return _Irej_tblCPerson_CommMember;
        }
        public static Irej_tblCPerson_JobNature CreateIrej_tblCPerson_JobNature()
        {
            //if (_Irej_tblCPerson_JobNature == null)
                _Irej_tblCPerson_JobNature = rej_tblCPerson_JobNatureDAL.GetInstance();
            return _Irej_tblCPerson_JobNature;
        }
        public static Irej_tblCPerson_Post CreateIrej_tblCPerson_Post()
        {
            //if (_Irej_tblCPerson_Post == null)
                _Irej_tblCPerson_Post = rej_tblCPerson_PostDAL.GetInstance();
            return _Irej_tblCPerson_Post;
        }
        public static Irej_tblCust_Branch CreateIrej_tblCust_Branch()
        {
            //if (_Irej_tblCust_Branch == null)
                _Irej_tblCust_Branch = rej_tblCust_BranchDAL.GetInstance();
            return _Irej_tblCust_Branch;
        }
        public static Irej_tblCust_Brand CreateIrej_tblCust_Brand()
        {
            //if (_Irej_tblCust_Brand == null)
                _Irej_tblCust_Brand = rej_tblCust_BrandDAL.GetInstance();
            return _Irej_tblCust_Brand;
        }
        public static Irej_tblCust_BusNature CreateIrej_tblCust_BusNature()
        {
            //if (_Irej_tblCust_BusNature == null)
                _Irej_tblCust_BusNature = rej_tblCust_BusNatureDAL.GetInstance();
            return _Irej_tblCust_BusNature;
        }
        public static Irej_tblCust_ContactPerson CreateIrej_tblCust_ContactPerson()
        {
            //if (_Irej_tblCust_ContactPerson == null)
                _Irej_tblCust_ContactPerson = rej_tblCust_ContactPersonDAL.GetInstance();
            return _Irej_tblCust_ContactPerson;
        }
        public static Irej_tblCust_Market CreateIrej_tblCust_Market()
        {
            //if (_Irej_tblCust_Market == null)
                _Irej_tblCust_Market = rej_tblCust_MarketDAL.GetInstance();
            return _Irej_tblCust_Market;
        }
        public static Irej_tblCust_Member CreateIrej_tblCust_Member()
        {
            //if (_Irej_tblCust_Member == null)
                _Irej_tblCust_Member = rej_tblCust_MemberDAL.GetInstance();
            return _Irej_tblCust_Member;
        }
        public static Irej_tblCust_ProdCat CreateIrej_tblCust_ProdCat()
        {
            //if (_Irej_tblCust_ProdCat == null)
                _Irej_tblCust_ProdCat = rej_tblCust_ProdCatDAL.GetInstance();
            return _Irej_tblCust_ProdCat;
        }
        public static Irej_tblCust_WebLogin CreateIrej_tblCust_WebLogin()
        {
            //if (_Irej_tblCust_WebLogin == null)
                _Irej_tblCust_WebLogin = rej_tblCust_WebLoginDAL.GetInstance();
            return _Irej_tblCust_WebLogin;
        }
        public static Irej_tblCustomer CreateIrej_tblCustomer()
        {
            //if (_Irej_tblCustomer == null)
                _Irej_tblCustomer = rej_tblCustomerDAL.GetInstance();
            return _Irej_tblCustomer;
        }
        public static Irej_tblHistory CreateIrej_tblHistory()
        {
            //if (_Irej_tblHistory == null)
                _Irej_tblHistory = rej_tblHistoryDAL.GetInstance();
            return _Irej_tblHistory;
        }
        public static Irej_tblContactPerson CreateIrej_tblContactPerson()
        {
            //if (_Irej_tblContactPerson == null)
                _Irej_tblContactPerson = rej_tblContactPersonDAL.GetInstance();
            return _Irej_tblContactPerson;
        }
        #endregion

        #region Istg对象
        private static Istg_tblAddress _Istg_tblAddress = null;
        private static Istg_tblContactInfo _Istg_tblContactInfo = null;
        private static Istg_tblContactPerson _Istg_tblContactPerson = null;
        private static Istg_tblCPerson_Attribute _Istg_tblCPerson_Attribute = null;
        private static Istg_tblCPerson_CommMember _Istg_tblCPerson_CommMember = null;
        private static Istg_tblCPerson_JobNature _Istg_tblCPerson_JobNature = null;
        private static Istg_tblCPerson_Post _Istg_tblCPerson_Post = null;
        private static Istg_tblCust_Branch _Istg_tblCust_Branch = null;
        private static Istg_tblCust_Brand _Istg_tblCust_Brand = null;
        private static Istg_tblCust_BusNature _Istg_tblCust_BusNature = null;
        private static Istg_tblCust_ContactPerson _Istg_tblCust_ContactPerson = null;
        private static Istg_tblCust_Market _Istg_tblCust_Market = null;
        private static Istg_tblCust_Member _Istg_tblCust_Member = null;
        private static Istg_tblCust_ProdCat _Istg_tblCust_ProdCat = null;
        private static Istg_tblCust_WebLogin _Istg_tblCust_WebLogin = null;
        private static Istg_tblCustomer _Istg_tblCustomer = null;
        private static Istg_tblHistory _Istg_tblHistory = null;
        #endregion
        #region Istg实例
        public static Istg_tblAddress CreateIstg_tblAddress()
        {
            //if (_Istg_tblAddress == null)
                _Istg_tblAddress = stg_tblAddressDAL.GetInstance();
            return _Istg_tblAddress;
        }
        public static Istg_tblContactInfo CreateIstg_tblContactInfo()
        {
            //if (_Istg_tblContactInfo == null)
                _Istg_tblContactInfo = stg_tblContactInfoDAL.GetInstance();
            return _Istg_tblContactInfo;
        }
        public static Istg_tblContactPerson CreateIstg_tblContactPerson()
        {
            //if (_Istg_tblContactPerson == null)
                _Istg_tblContactPerson = stg_tblContactPersonDAL.GetInstance();
            return _Istg_tblContactPerson;
        }
        public static Istg_tblCPerson_Attribute CreateIstg_tblCPerson_Attribute()
        {
            //if (_Istg_tblCPerson_Attribute == null)
                _Istg_tblCPerson_Attribute = stg_tblCPerson_AttributeDAL.GetInstance();
            return _Istg_tblCPerson_Attribute;
        }
        public static Istg_tblCPerson_CommMember CreateIstg_tblCPerson_CommMember()
        {
            //if (_Istg_tblCPerson_CommMember == null)
                _Istg_tblCPerson_CommMember = stg_tblCPerson_CommMemberDAL.GetInstance();
            return _Istg_tblCPerson_CommMember;
        }
        public static Istg_tblCPerson_JobNature CreateIstg_tblCPerson_JobNature()
        {
            //if (_Istg_tblCPerson_JobNature == null)
                _Istg_tblCPerson_JobNature = stg_tblCPerson_JobNatureDAL.GetInstance();
            return _Istg_tblCPerson_JobNature;
        }
        public static Istg_tblCPerson_Post CreateIstg_tblCPerson_Post()
        {
            //if (_Istg_tblCPerson_Post == null)
                _Istg_tblCPerson_Post = stg_tblCPerson_PostDAL.GetInstance();
            return _Istg_tblCPerson_Post;
        }
        public static Istg_tblCust_Branch CreateIstg_tblCust_Branch()
        {
            //if (_Istg_tblCust_Branch == null)
                _Istg_tblCust_Branch = stg_tblCust_BranchDAL.GetInstance();
            return _Istg_tblCust_Branch;
        }
        public static Istg_tblCust_Brand CreateIstg_tblCust_Brand()
        {
            //if (_Istg_tblCust_Brand == null)
                _Istg_tblCust_Brand = stg_tblCust_BrandDAL.GetInstance();
            return _Istg_tblCust_Brand;
        }
        public static Istg_tblCust_BusNature CreateIstg_tblCust_BusNature()
        {
            //if (_Istg_tblCust_BusNature == null)
                _Istg_tblCust_BusNature = stg_tblCust_BusNatureDAL.GetInstance();
            return _Istg_tblCust_BusNature;
        }
        public static Istg_tblCust_ContactPerson CreateIstg_tblCust_ContactPerson()
        {
            //if (_Istg_tblCust_ContactPerson == null)
                _Istg_tblCust_ContactPerson = stg_tblCust_ContactPersonDAL.GetInstance();
            return _Istg_tblCust_ContactPerson;
        }
        public static Istg_tblCust_Market CreateIstg_tblCust_Market()
        {
            //if (_Istg_tblCust_Market == null)
                _Istg_tblCust_Market = stg_tblCust_MarketDAL.GetInstance();
            return _Istg_tblCust_Market;
        }
        public static Istg_tblCust_Member CreateIstg_tblCust_Member()
        {
            //if (_Istg_tblCust_Member == null)
                _Istg_tblCust_Member = stg_tblCust_MemberDAL.GetInstance();
            return _Istg_tblCust_Member;
        }
        public static Istg_tblCust_ProdCat CreateIstg_tblCust_ProdCat()
        {
            //if (_Istg_tblCust_ProdCat == null)
                _Istg_tblCust_ProdCat = stg_tblCust_ProdCatDAL.GetInstance();
            return _Istg_tblCust_ProdCat;
        }
        public static Istg_tblCust_WebLogin CreateIstg_tblCust_WebLogin()
        {
            //if (_Istg_tblCust_WebLogin == null)
                _Istg_tblCust_WebLogin = stg_tblCust_WebLoginDAL.GetInstance();
            return _Istg_tblCust_WebLogin;
        }
        public static Istg_tblCustomer CreateIstg_tblCustomer()
        {
            //if (_Istg_tblCustomer == null)
                _Istg_tblCustomer = stg_tblCustomerDAL.GetInstance();
            return _Istg_tblCustomer;
        }
        public static Istg_tblHistory CreateIstg_tblHistory()
        {
            //if (_Istg_tblHistory == null)
                _Istg_tblHistory = stg_tblHistoryDAL.GetInstance();
            return _Istg_tblHistory;
        }
        #endregion

        #region Itbl对象
        private static ItblCustomer _ItblCustomer = null;
        private static ItblAccessRight _ItblAccessRight = null;
        private static ItblAct_ContactPerson _ItblAct_ContactPerson = null;
        private static ItblActivite _ItblActivite = null;
        private static ItblAddress _ItblAddress = null;
        private static ItblAuditTrail _ItblAuditTrail = null;
        private static ItblContactInfo _ItblContactInfo = null;
        private static ItblContactPerson _ItblContactPerson = null;
        private static ItblCPerson_Attribute _ItblCPerson_Attribute = null;
        private static ItblCPerson_CommMember _ItblCPerson_CommMember = null;
        private static ItblCPerson_JobNature _ItblCPerson_JobNature = null;
        private static ItblCPerson_Post _ItblCPerson_Post = null;
        private static ItblCust_Branch _ItblCust_Branch = null;
        private static ItblBrand_ProdCat _ItblBrand_ProdCat = null;
        private static ItblCust_BusNature _ItblCust_BusNature = null;
        private static ItblCust_ContactPerson _ItblCust_ContactPerson = null;
        private static ItblCust_Market _ItblCust_Market = null;
        private static ItblCust_Member _ItblCust_Member = null;
        private static ItblCust_ProdCat _ItblCust_ProdCat = null;
        private static ItblCust_WebLogin _ItblCust_WebLogin = null;
        private static ItblHistory _ItblHistory = null;
        private static ItblUser _ItblUser = null;
        private static ItblMediaRoom _ItblMediaRoom=null;
        private static ItblMediaRoomRelated _ItblMediaRoomRelated = null;
        #endregion
        # region Itbl实例
        public static ItblCustomer CreateItblCustomer()
        {
            //if (_ItblCustomer == null)
                _ItblCustomer = tblCustomerDAL.GetInstance();
            return _ItblCustomer;
        }
        public static ItblAccessRight CreateItblAccessRight()
        {
            //if (_ItblAccessRight == null)
                _ItblAccessRight = tblAccessRightDAL.GetInstance();
            return _ItblAccessRight;
        }
        public static ItblAct_ContactPerson CreateItblAct_ContactPerson()
        {
            //if (_ItblAct_ContactPerson == null)
                _ItblAct_ContactPerson = tblAct_ContactPersonDAL.GetInstance();
            return _ItblAct_ContactPerson;
        }
        public static ItblActivite CreateItblActivite()
        {
            //if (_ItblActivite == null)
                _ItblActivite =  tblActiviteDAL.GetInstance();
            return _ItblActivite;
        }
        public static ItblAddress CreateItblAddress()
        {
            //if (_ItblAddress == null)
                _ItblAddress = tblAddressDAL.GetInstance();
            return _ItblAddress;
        }
        public static ItblAuditTrail CreateItblAuditTrail()
        {
            //if (_ItblAuditTrail == null)
                _ItblAuditTrail = tblAuditTrailDAL.GetInstance();
            return _ItblAuditTrail;
        }
        public static ItblContactInfo CreateItblContactInfo()
        {
            //if (_ItblContactInfo == null)
                _ItblContactInfo = tblContactInfoDAL.GetInstance();
            return _ItblContactInfo;
        }
        public static ItblContactPerson CreateItblContactPerson()
        {
            //if (_ItblContactPerson == null)
                _ItblContactPerson = tblContactPersonDAL.GetInstance();
            return _ItblContactPerson;
        }
        public static ItblCPerson_Attribute CreateItblCPerson_Attribute()
        {
            //if (_ItblCPerson_Attribute == null)
                _ItblCPerson_Attribute = tblCPerson_AttributeDAL.GetInstance();
            return _ItblCPerson_Attribute;
        }
        public static ItblCPerson_CommMember CreateItblCPerson_CommMember()
        {
            //if (_ItblCPerson_CommMember == null)
                _ItblCPerson_CommMember = tblCPerson_CommMemberDAL.GetInstance();
            return _ItblCPerson_CommMember;
        }
        public static ItblCPerson_JobNature CreateItblCPerson_JobNature()
        {
            //if (_ItblCPerson_JobNature == null)
                _ItblCPerson_JobNature = tblCPerson_JobNatureDAL.GetInstance();
            return _ItblCPerson_JobNature;
        }
        public static ItblCPerson_Post CreateItblCPerson_Post()
        {
            //if (_ItblCPerson_Post == null)
                _ItblCPerson_Post = tblCPerson_PostDAL.GetInstance();
            return _ItblCPerson_Post;
        }
        public static ItblCust_Branch CreateItblCust_Branch()
        {
            //if (_ItblCust_Branch == null)
                _ItblCust_Branch = tblCust_BranchDAL.GetInstance();
            return _ItblCust_Branch;
        }
        public static ItblBrand_ProdCat CreateItblBrand_ProdCat()
        {
            //if (_ItblBrand_ProdCat == null)
                _ItblBrand_ProdCat = tblBrand_ProdCatDAL.GetInstance();
            return _ItblBrand_ProdCat;
        }
        public static ItblCust_BusNature CreateItblCust_BusNature()
        {
            //if (_ItblCust_BusNature == null)
                _ItblCust_BusNature = tblCust_BusNatureDAL.GetInstance();
            return _ItblCust_BusNature;
        }
        public static ItblCust_ContactPerson CreateItblCust_ContactPerson()
        {
            //if (_ItblCust_ContactPerson == null)
                _ItblCust_ContactPerson = tblCust_ContactPersonDAL.GetInstance();
            return _ItblCust_ContactPerson;
        }
        public static ItblCust_Market CreateItblCust_Market()
        {
            //if (_ItblCust_Market == null)
                _ItblCust_Market = tblCust_MarketDAL.GetInstance();
            return _ItblCust_Market;
        }
        public static ItblCust_Member CreateItblCust_Member()
        {
            //if (_ItblCust_Member == null)
                _ItblCust_Member = tblCust_MemberDAL.GetInstance();
            return _ItblCust_Member;
        }
        public static ItblCust_ProdCat CreateItblCust_ProdCat()
        {
            //if (_ItblCust_ProdCat == null)
                _ItblCust_ProdCat = tblCust_ProdCatDAL.GetInstance();
            return _ItblCust_ProdCat;
        }
        public static ItblCust_WebLogin CreateItblCust_WebLogin()
        {
            //if (_ItblCust_WebLogin == null)
                _ItblCust_WebLogin = tblCust_WebLoginDAL.GetInstance();
            return _ItblCust_WebLogin;
        }
        public static ItblHistory CreateItblHistory()
        {
            //if (_ItblHistory == null)
                _ItblHistory = tblHistoryDAL.GetInstance();
            return _ItblHistory;
        }
        public static ItblUser CreateItblUser()
        {
            //if (_ItblUser == null)
                _ItblUser = tblUserDAL.GetInstance();
            return _ItblUser;
        }

        public static ItblMediaRoom CreateItblMediaRoom()
        {
            //if (_ItblMediaRoom == null)
                _ItblMediaRoom = tblMediaRoomDAL.GetInstance();
            return _ItblMediaRoom;
        }

        public static ItblMediaRoomRelated CreateItblMediaRoomRelated()
        {
            //if (_ItblMediaRoomRelated == null)
                _ItblMediaRoomRelated = tblMediaRoomRelatedDAL.GetInstance();
            return _ItblMediaRoomRelated;
        }

        #endregion


        #region 对象
        public static Iapp_mtblBrand _Iapp_mtblBrand = null;
        public static Iapp_tblAddress _Iapp_tblAddress = null;
        public static Iapp_tblBrand_ProdCat _Iapp_tblBrand_ProdCat = null;
        public static Iapp_tblContactInfo _Iapp_tblContactInfo = null;
        public static Iapp_tblContactPerson _Iapp_tblContactPerson = null;
        public static Iapp_tblCPerson_Attribute _Iapp_tblCPerson_Attribute = null;
        public static Iapp_tblCPerson_CommMember _Iapp_tblCPerson_CommMember = null;
        public static Iapp_tblCPerson_JobNature _Iapp_tblCPerson_JobNature = null;
        public static Iapp_tblCust_Branch _Iapp_tblCust_Branch = null;
        public static Iapp_tblCust_BusNature _Iapp_tblCust_BusNature = null;
        public static Iapp_tblCust_ContactPerson _Iapp_tblCust_ContactPerson = null;
        public static Iapp_tblCust_Market _Iapp_tblCust_Market = null;
        public static Iapp_tblCust_ProdCat _Iapp_tblCust_ProdCat = null;
        public static Iapp_tblCustomer _Iapp_tblCustomer = null;
        public static Iapp_tblMediaRoom _Iapp_tblMediaRoom = null;
        public static Iapp_tblMediaRoom_Related _Iapp_tblMediaRoom_Related = null;
        #endregion

        #region 实例
        public static Iapp_mtblBrand CreateIapp_mtblBrand()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_mtblBrand = app_mtblBrandDAL.GetInstance();
            return _Iapp_mtblBrand;
        }
        public static Iapp_tblAddress CreateIapp_tblAddress()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblAddress = app_tblAddressDAL.GetInstance();
            return _Iapp_tblAddress;
        }
        public static Iapp_tblBrand_ProdCat CreateIapp_tblBrand_ProdCat()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblBrand_ProdCat = app_tblBrand_ProdCatDAL.GetInstance();
            return _Iapp_tblBrand_ProdCat;
        }
        public static Iapp_tblContactInfo CreateIapp_tblContactInfo()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblContactInfo = app_tblContactInfoDAL.GetInstance();
            return _Iapp_tblContactInfo;
        }
        public static Iapp_tblContactPerson CreateIapp_tblContactPerson()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblContactPerson = app_tblContactPersonDAL.GetInstance();
            return _Iapp_tblContactPerson;
        }
        public static Iapp_tblCPerson_Attribute CreateIapp_tblCPerson_Attribute()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCPerson_Attribute = app_tblCPerson_AttributeDAL.GetInstance();
            return _Iapp_tblCPerson_Attribute;
        }
        public static Iapp_tblCPerson_CommMember CreateIapp_tblCPerson_CommMember()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCPerson_CommMember = app_tblCPerson_CommMemberDAL.GetInstance();
            return _Iapp_tblCPerson_CommMember;
        }
        public static Iapp_tblCPerson_JobNature CreateIapp_tblCPerson_JobNature()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCPerson_JobNature = app_tblCPerson_JobNatureDAL.GetInstance();
            return _Iapp_tblCPerson_JobNature;
        }
        public static Iapp_tblCust_Branch CreateIapp_tblCust_Branch()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCust_Branch = app_tblCust_BranchDAL.GetInstance();
            return _Iapp_tblCust_Branch;
        }
        public static Iapp_tblCust_BusNature CreateIapp_tblCust_BusNature()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCust_BusNature = app_tblCust_BusNatureDAL.GetInstance();
            return _Iapp_tblCust_BusNature;
        }
        public static Iapp_tblCust_ContactPerson CreateIapp_tblCust_ContactPerson()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCust_ContactPerson = app_tblCust_ContactPersonDAL.GetInstance();
            return _Iapp_tblCust_ContactPerson;
        }
        public static Iapp_tblCust_Market CreateIapp_tblCust_Market()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCust_Market = app_tblCust_MarketDAL.GetInstance();
            return _Iapp_tblCust_Market;
        }
        public static Iapp_tblCust_ProdCat CreateIapp_tblCust_ProdCat()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCust_ProdCat = app_tblCust_ProdCatDAL.GetInstance();
            return _Iapp_tblCust_ProdCat;
        }
        public static Iapp_tblCustomer CreateIapp_tblCustomer()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblCustomer = app_tblCustomerDAL.GetInstance();
            return _Iapp_tblCustomer;
        }
        public static Iapp_tblMediaRoom CreateIapp_tblMediaRoom()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblMediaRoom = app_tblMediaRoomDAL.GetInstance();
            return _Iapp_tblMediaRoom;
        }
        public static Iapp_tblMediaRoom_Related CreateIapp_tblMediaRoom_Related()
        {
            //if (_ItblMediaRoomRelated == null)
            _Iapp_tblMediaRoom_Related = app_tblMediaRoom_RelatedDAL.GetInstance();
            return _Iapp_tblMediaRoom_Related;
        }
        #endregion

        #region Im对象
        private static ItbCodeGeneratorDAL _ItbCodeBuilder = null;
        #endregion
        #region Im实例
        public static ItbCodeGeneratorDAL CreateICodeBuilder()
        {
            //if (_ItbCodeBuilder == null)
                _ItbCodeBuilder = tbCodeGeneratorDAL.GetInstance();
            return _ItbCodeBuilder;
        }
        #endregion



        #region 自定义实体类

        private static ISearch_Cust_Info _ISearch_Cust_Info = null;

        public static ISearch_Cust_Info CreateISearch_Cust_Info()
        {
            _ISearch_Cust_Info = new Search_Cust_InfoDAL();
            return _ISearch_Cust_Info;
        }

        #endregion
    }
}
